<template>
    <view>
        <status-bar :title="type == 1 ? '加盟协议' : '众筹协议'"></status-bar>
        <view class="cont padding30">
            <u-parse :content="content" :domain="imgUrl" :selectable="true"></u-parse>
        </view>
        <view class="btns d-flex j-se white">
            <view class="flexac bg80 size32" @click="back()">不签约</view>
            <view class="flexac size32" @click="toUrl('/joinPage/sign?type=' + type + '&store_id=' + store_id)">签约</view>
        </view>
    </view>
</template>

<script>
export default {
    data(){
        return {
            type: 1, // 加盟协议1、众筹协议2
            store_id: '',
            content: '',
            imgUrl: this.imgUrl
        }
    },
    onLoad(e){
        if(e.type) this.type = e.type
        if(e.store_id) this.store_id = e.store_id
        this.getCont()
    },
    methods: {
        getCont(){
			this.$http.post({
				url: '/osmxcxApi/getConfig'
			}).then(res=>{
				if(this.type == 1){
                    this.content = res.data.join.agreement
                } else if(this.type == 2){
                    this.content = res.data.crowdfunding.agreement
                }
			})
		},
    }
}
</script>

<style lang="scss" scoped>
.cont {
    padding-bottom: calc(140rpx + constant(safe-area-inset-bottom));
    padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
}
.btns {
    width: 100%;
    position: fixed;
    left: 0;
    bottom: calc(30rpx + constant(safe-area-inset-bottom));
    bottom: calc(30rpx + env(safe-area-inset-bottom));
    z-index: 10;
    view {
        width: 280rpx;
        height: 80rpx;
        border-radius: 40rpx;
        &:last-child {
            background: #FF0000;
        }
    }
}
</style>